Tiny Hexer Script: Variables

In Tiny Hexer script you can use variables to store specific data.


top bottom

top bottom

Overview

Valid variable names are sequences of at least one alphanumeric character or the underline character (_). A variable name must not start with a number digit. Valid variable names are e.g. _1, Var1, _test_. Invalid variable names are e.g. 1var, v$a. Identifiers reserved in Tiny Hexer Script (like function and command names) cannot be used as variable names.

Variables must be declared before accessing them in a script using the VAR command. When a variable is declared using the VAR command, its data type is defined and cannot be changed afterwards.

To assign data to a variable, use the LET command.

By default, sub routines (CALL and LOOP commands) use copies of declared variables (like environmental variables in batch scripts), so the sub routine can access the variable and change its value locally, but after termination of the sub routine (RETURN command) the original value of the variable is restored. This behaviour can be changed using the OPTION GLOBALVARS directive.


top bottom

Variable tagging

Variable tagging is used to create hyperlinks in the structure viewer. Each variable can have a position and length tag. Variable tagging is disabled by default, this behaviour can be controlled by the OPTION READTAGS directive.

If tagging is enabled, the FILEREAD command and function set the tag of the variable to the file position before reading and the amount of data being read. The following commands and functions allow you to access and modify variable tags: COPYTAGS, TAGVAR, TAG_POS() and TAG_LEN().


top bottom

Special variables

The following special variables exist in Tiny Hexer:


top bottom
mirkes.de's Tiny Hexer, Copyright ⌐ Markus Stephany. All rights reserved.